﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SwenAssignment3.Classes;

namespace SwenAssignment3.Login
{
    public partial class LoginPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSignIn_Click(object sender, ImageClickEventArgs e)
        {
            string username = tbxUsername.Text;
            string password = tbxPassword.Text;

            if (DRHotelDBManager.Login(username, password) == true)
            {
                Session["username"] = username;
                Response.Redirect("~/RoomAvailabilityCumBookingModule/RoomBooking.aspx");
            }
            else
            {
                lblStatus.Text = "You have entered the wrong username or password";
            }
        }
    }
}